﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fur.Htx.Core.Entities
{
    [Table("Sys_User")]
    public class UserInfo: Entity, IEntitySeedData<UserInfo>
    {
        /// <summary>
        /// 姓名
        /// </summary>
        [Comment("姓名")]
        public string Name { get; set; }
        /// <summary>
        /// 用户编码
        /// </summary>
        [Comment("用户编码")]
        public string Code { get; set; }
        /// <summary>
        /// 年龄
        /// </summary>
        [Comment("年龄")]
        public int Age { get; set; }
        /// <summary>
        /// 用户详情
        /// </summary>
        public virtual UserDetail Detail { get; set; }

        public IEnumerable<UserInfo> HasData(DbContext dbContext, Type dbContextLocator)
        {
            return new List<UserInfo> { 
                new UserInfo{ Id = 1, Name = "孙小双", Code = "sunxsh", Age = 33, CreatedTime = DateTime.Now },
                new UserInfo{ Id = 2, Name = "李怡然", Code = "liyr", Age = 28, CreatedTime = DateTime.Now },
                new UserInfo{ Id = 3, Name = "孙远杰", Code = "sunyj", Age = 18, CreatedTime = DateTime.Now },
            };
        }
    }
}
